package com.hwg.emp.service.impl;

import java.util.List;

import com.hwg.emp.common.service.CommonService;
import com.hwg.emp.dao.DaoFactory;
import com.hwg.emp.dao.ModuleDAO;
import com.hwg.emp.model.ModuleMD;
import com.hwg.emp.service.ModuleService;

public class ModuleServiceImpl extends CommonService implements ModuleService {

	private ModuleDAO dao = DaoFactory.getDao(ModuleDAO.class);
	
	@Override
	public List<ModuleMD> getParentModuleByRoleID(String id) throws Exception {
		List<ModuleMD> modules = dao.selectParentModuleByRoleID(id);
		assertNotNull("没有找到对应的功能", modules);
		return modules;
	}

	@Override
	public List<ModuleMD> getModuleByParentId(String id) throws Exception {
		List<ModuleMD> modules = dao.selectModuleByParentId(id);
		assertNotNull("没有找到对应的功能", modules);
		return modules;
	}

}
